package com.uam.core.entity.model;

import com.alibaba.fastjson.JSONArray;
import com.uam.core.lk.utils.fencebuffer.BufferBase;
import lombok.Data;
import org.locationtech.jts.geom.Geometry;
import org.locationtech.jts.geom.LineString;

/**
 * @author heuanglong
 */

@Data
public class PolygonV1 {
    private JSONArray points;
    private Long taskId;
    private Integer floor;
    private Integer safeDistance;
    private LineString lineString;
    private double avgSpeed;

    public PolygonV1(String points, Long taskId, Integer floor, Integer safeDistance, String lineString,double avgSpeed)  {
        this.points = JSONArray.parseArray(points);
		try {
			Geometry geometry = BufferBase.wktReader.read(lineString);
			this.lineString =(LineString)geometry;
		}catch (Exception e){
			e.toString();
		}
        this.taskId = taskId;
        this.floor = floor;
        this.safeDistance = safeDistance;
        this.avgSpeed=avgSpeed;
    }
}
